home *** CD-ROM | disk | FTP | other *** search
Wrap
// smileys.vsc - shows graphical smiley icons // * To add more smileys, put the .bmp files in your image folder, then // edit the @l line at the top of the DOSMILEYS alias. Name Smileys for ViRC 2 // Version check if $exebuild < 114 MessageBox smileys.vsc requires ViRC 2.0rc2 (200/114 or later). Halt endif // Set up images @ $Smileys = $null @ $Smileys[:)] = smile.bmp @ $Smileys[;)] = wink.bmp @ $Smileys[>:(] = angry.bmp @ $Smileys[:(] = frown.bmp @ $Smileys[:D] = grin.bmp @ $Smileys[:P] = tongue.bmp @ $Smileys[:p] = tongue.bmp // Verify image files @l $notfound = $null foreach ($file; $arrayvalues($Smileys)) if !$fileexists($getpath(image)$file) @l $notfound = $listcat($notfound $listquote($file)) endif endforeach if [$notfound] != [] @l $msg = Some image files for smileys.vsc could not be found. You will not be able to see graphical smileys unless the files are in your image folder ($getpath(image)). The missing files are:$char(13) foreach ($file; $notfound) @l $msg = $msg$char(13)$file endforeach @l $msg = $msg$char(13)$char(13)The files are probably in the Images directory in your ViRC folder ($getpath(virc)Images). Please move them to $getpath(image) and restart ViRC. MessageBox $msg endif // Settings AddScriptControl config check "Show graphical smileys" smileys_enabled = 1 // Aliases Alias DOSMILEYS if $getsetting(smileys_enabled) @l $subst = $null foreach ($from,$to; $Smileys) @l $subst = $listcat($subst $listquote( $from ) $listquote( \S@bmp:$bitmap($to):$from\S )) endforeach // add a temporary space on each end to match smileys at the beginning/end @l $x = $replace($listquote( $1- ) $subst) @ $fresult = $substr($x 2 $($length($x) - 2)) else @ $fresult = $1- endif EndAlias // Events Event PRIVMSG_smileys -before "% PRIVMSG" // don't edit ctcp requests if [$substr($3 2 1)] != [\A] SetEventLine $0 $1 $2 :$dosmileys($strtrim($3-)) endif EndEvent Event NOTICE_smileys -before "% NOTICE" // don't edit ctcp replies if [$substr($3 2 1)] != [\A] SetEventLine $0 $1 $2 :$dosmileys($strtrim($3-)) endif EndEvent Event <OnMyChanText_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyPrivMsg_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyQueryText_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyQueryAction_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyChanAction_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyPrivAction_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent Event <OnMyNotice_smileys> -before "*" SetEventLine $0 $dosmileys($1-) EndEvent